<?php
/**
 * Created by PhpStorm.
 * User: clcw908
 * Date: 2016/11/18
 * Time: 14:44
 */
namespace AuctionCore\Company;

class CompanyManage{

	/**
	 *  得到公司城市列表
	 *
	 * @return mixed
	 */
	public static function get_company_city()
	{
		$field = 'compony.branch_id,compony.city_code,city.name';
		$arr = M('branch_city')->field($field)
			->alias('compony')
			->join(" LEFT JOIN " . C('DB_PREFIX') . "apply_city as city ON compony.`city_code`=city.`code`")
			->select();
		return $arr;
	}


	/**
	 *  根据分公司编号，得到城市信息
	 *
	 * @param $branchId
	 * @return mixed
	 */
	public static function getCityCodeByBranchId($branchId){
		$arr = M('branch_city')
			->where(['branch_id'=>$branchId])
			->select();
		return $arr;
	}
}